<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>pay.html</title>
</head>
 <body>
 <script type="text/javascript">
 	var winAccountPay = new Windows("win_accounting_pay");
	var oAccountPay = {
		initForm : function(){
		    winAccountPay.find("#AccountPayForm").form({
 			url:'${basePath}/admin/nethsoft/accounting/doPay',
 			onSubmit: function(){
		    	var pass = winAccountPay.find("#AccountPayForm").form("validate");
		    	if(pass){
		    		winAccountPay.find("#ok").linkbutton("loading");
		    	}
		    	return pass; 
		    },
		    success:function(data){
		   		var result = jQuery.parseJSON(data);   
		        if(result.success == true){
		       		top.Notiy.success("保存成功!");
	        		winAccountPay.setReturnValue(true);
					winAccountPay.close();
		        }else{
		        	top.Dialog.alert("保存失败!",result.error,"error");
		        }
		        winAccountPay.find("#ok").linkbutton("reset");
		    }
 		});
		},
		ok : function(){
			winAccountPay.find('#AccountPayForm').submit();
		},
		cancel : function(){
			winAccountPay.close();
		}
	}
 	$(function(){
 		oAccountPay.initForm();
 	});
 </script>
 <div class="easyui-layout" data-options="fit:true">
	 <div data-options="region:'center',border:false">
	 	<form id="AccountPayForm" method="post" style="padding-top:10px;padding-left:20px;">
	 		<table width="90%" style="line-height: 25px;">
				<tr>
					<td width="20%">日期</td>
					<td><input class="easyui-datebox" required="required" type="text" name="datetime" style="width:150px" /></td>
				</tr>
				<tr>
					<td width="20%">摘要</td>
					<td><input class="easyui-validatebox" required="required" type="text" name="descript" style="width:100%" /></td>
				</tr>
				<tr>
					<td width="20%">支出金额</td>
					<td><input class="easyui-numberbox" required="required" type="text" name="pay" data-options="precision:2,prefix:'￥'" style="width:100%" /></td>
				</tr>
				<tr>
					<td width="20%">备注</td>
					<td><textarea class="easyui-textarea" type="text" name="comments" style="width:100%" rows="5"></textarea></td>
				</tr>
			</table>
		</form>
	 </div>
	 <!--Change Button Text-->
	 <div data-options="region:'south',border:false">
		<div class="dialog-button">
			<a id="ok" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="oAccountPay.ok()">确定</a>
			<a id="cancel" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="oAccountPay.cancel()">取消</a>
		</div>
	</div>
 </div>
  </body>
</html>
